package com.example.smartclassroom.controller;

import com.example.smartclassroom.entity.Examplan;
import com.example.smartclassroom.service.ExamplanService;
import com.example.smartclassroom.util.JsonDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/examplan")
public class ExamplanController {

    @Autowired
    private ExamplanService examplanService;

    /**
     * 新增考试安排
     * @param examplan
     * @return
     */
    @PostMapping("addExamplan")
    public JsonDate addExamplan(Examplan examplan) {
        return examplanService.addExamplan(examplan);
    }

    /**
     * 删除和批量删除考试安排
     * @param ids
     * @return
     */
    @RequestMapping("deleteExamplan")
    public  JsonDate deleteExamplan(Integer[] ids) {
      return examplanService.deleteExamplan(ids);
    }


    /**
     * 修改考试安排
     * @param examplan
     * @return
     */
    @PostMapping("updateExamplan")
    public JsonDate updateExamplan(Examplan examplan) {
        return examplanService.updateExamplan(examplan);
    }

    /**
     * 查询所有考试安排
     * @param examplan
     * @return
     */
    @GetMapping("/queryAllExamplan")
    public JsonDate queryAllExamplan(Examplan examplan) {
        return examplanService.queryAllExamplan(examplan);
    }

}
